package com.xlx.common.utils;

import lombok.Data;

@Data
public class JsonResult {
    private Integer code;
    private String msg;
    private Object data;

    public JsonResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static JsonResult success(Object data){
        return new JsonResult(200,"成功",data);
    }
    public static JsonResult error(String msg){
        return new JsonResult(0,msg,null);
    }
}